package com.wc.AlgoOJ_homework.ALOJ模块测试Ⅲ.E_补给;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/5/20 17:02
 * @description http://43.138.190.70:8888/p/187?tid=66444686c0c2f98e569f403b
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 20, M = 1 << N;
    static double INF = 1e30;
    static double[][] g = new double[N][N];
    static double[][] f = new double[M][N];
    static int[][] a = new int[N][2];
    static int n, d;

    public static void main(String[] args) {
        n = sc.nextInt();
        d = sc.nextInt();
        for (int i = 0; i < n; i++) {
            a[i][0] = sc.nextInt();
            a[i][1] = sc.nextInt();
        }

        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                double dist = getD(a[i][0] - a[j][0], a[i][1] - a[j][1]);
                if (dist <= d) g[i][j] = g[j][i] = dist;
                else g[i][j] = g[j][i] = INF;
            }
        }

        // floyd
        for (int k = 0; k < n; k++) {
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    g[i][j] = Math.min(g[i][j], g[i][k] + g[k][j]);
                }
            }
        }

        for (int i = 0; i < 1 << n; i++) {
            for (int j = 0; j < n; j++) {
                f[i][j] = INF;
            }
        }
        f[1][0] = 0;
        for (int i = 0; i < 1 << n; i++) {
            for (int j = 0; j < n; j++) {
                if ((i >> j & 1) == 1) {
                    for (int k = 0; k < n; k++) {
                        if ((i >> k & 1) == 1 && j != k)
                            f[i][j] = Math.min(f[i][j], f[i ^ (1 << j)][k] + g[k][j]);
                    }
                }
            }
        }
        double res = INF;
        for (int i = 0; i < n; i++) res = Math.min(f[(1 << n) - 1][i] + g[i][0], res);
        out.printf("%.2f\n", res);
        out.flush();
    }

    static double getD(int dx, int dy) {
        return Math.sqrt(dx * dx + dy * dy);
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
